//           https://ac.nowcoder.com/acm/problem/219035





#include <iostream>
using namespace std;

int main()
{
    int T;
    cin >> T;
    while (T--)
    {
        long long n, a, b;
        cin >> n >> a >> b;
        if (n <= 2)
        {
            if (a > b) cout << b << endl;
            else cout << a << endl;
            continue;
        }
        long long ans = 0;
        if (a / 2 < b / 3)
        {
            ans += (n / 2) * a;
            n %= 2;
            if (n)
                ans += min(a, b - a);
        }
        else
        {
            ans += (n / 3) * b;
            n %= 3;
            if (n == 1)
                ans += min(min(a, b), 2 * a - b);
            else if (n == 2)
                ans += min(a, b);
        }
        cout << ans << endl;
    }
    return 0;
}